
import React from 'react';
import { Carousel,Flex,Icon } from 'antd-mobile';
import { routerRedux } from 'dva/router';

import styles from './index.less';

const empty = require('is-empty');
class WitAnnouncement extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      carouselNumber1: 1,
      initialCarouselHeight1: '0rem',
      carouselNumber2: 1,
      initialCarouselHeight2: '0rem',
    };
  }

  //点击通知通告消息队列
  handleNotice = (index) => {
    const {dispatch}=this.props;
    dispatch(
      routerRedux.push({
        pathname: `/infor/mienDetail`,
        query: {id: index}
      })
    )
  };


  render() {
    const {tit,info,time,index}=this.props;

    return (
      <div onClick={()=>this.handleNotice(index)} style={{borderTop: '0.01rem solid #ddd',boxSizing: 'border-box',width: '100%',padding: '0.3rem 0.3rem',backgroundColor: '#fff'}}>
        <div style={{width: '100%',lineHeight:'0.5rem',fontSize: '0.35rem',letterSpacing: '0.02rem'}}>
          {tit.substr(0,18)}
        </div>
        <div style={{width: '100%',marginTop: '0.2rem',lineHeight:'0.4rem',fontSize: '0.32rem',letterSpacing: '0.02rem',color: '#999'}}>
          {info.substr(0,18)}
        </div>
        <div style={{width: '100%',marginTop: '0.2rem',color: '#999',fontSize: '0.3rem'}}>
          <span style={{marginRight: '0.15rem'}}>{time}</span>
        </div>
      </div>
    )
  }
}

export default WitAnnouncement;
